home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network PC
/
Network PC.iso
/
windows 95 utilities
/
programming tools
/
extended pagecontrol
/
readme.txt
< prev
next >
Wrap
Text File
|
1997-04-19
|
14KB
|
378 lines
Extended PageControl and Extended TabControl v2.2
for Delphi and Borland C++Builder
---------------------------------------------------------
ExtPageControl and ExtTabControl are enhancements of
component TPageControl and TTabControl in Delphi 2 / 3
and Borland C++Builder.
What are the enhancements of these components?
==============================================
- You can change the color of active and inactive
tabs
- Each tab can have a bitmap
- You can select different font for active and inactive
tabs
- Give the TabSheets another background color
- Tabs can be placed on top, bottom, the left or
right side of the component
- A button mode is available if tabs are placed on
top. In button mode the components becomes borderless.
That can be usefully if you want to write wizard-like
programs (set property TabVisible to false on all
tabsheets).
- Define a different Hint for each tab
- Disabled TabSheets/Tabs get a grayed tab-text (as
everyone expects on a disabled control)
- A new OwnerDraw style is established (event OnDrawTab).
Using this event you can draw the contents of the tabs
yourself.
- Support for accelerator keys (ALT + hotkey)
- Successfully tested with Delphi 3
Note:
To place tabs on left, right or bottom of the component you
may need an updated version of Microsofts Common Controls
library ComCtl32.DLL. A new version of ComCtl32.DLL ships
with Windows NT 4, Windows 97 and Internet Explorer 3. You
can download Internet Explorer from Microsofts Web-Site
http://www.microsoft.com/ie/download/
Files
=====
EXTPAGE.DCR -> component image for Delphi and C++Builder
EXTPAGE.DCU -> component for Delphi
EXTPAGE.HPP -> include file for C++Builder
EXTPAGE.INT -> interface file for user
EXTPAGE.OBJ -> component for C++Builder
FILE_ID.DIZ -> short information for user
ORDER.TXT -> order information for user
README.TXT -> this file
SAMPLE.DPR -> sample project for Delphi
SAMPLE.EXE -> running sample program
SAMPLE1.DFM -> sample form for Delphi and C++Builder
SAMPLE1.PAS -> sample file for Delphi and C++Builder
Installation
============
Installation in Delphi
======================
1. Copy files EXTPAGE.DCR and EXTPAGE.DCU into a directory,
where your components reside, for instance
C:\Programs\Delphi2\Lib
2. From the Delphi menu select
Component | Install ...
3. Press the Add button, and select the path and filename of
EXTPAGE.DCU. In the browse dialog pull down the 'Files of
Type' combo box at the bottom and select file type (*.DCU).
4. Back on the Install Components screen press OK.
If installation succeeds you should see the ExtPageControl
and ExtTabControl appear on the Win95 palette. If you have any
difficulty installing the components refer to the Delphi Help
system.
Installation in Borland C++Builder
==================================
1. Copy files EXTPAGE.DCR and EXTPAGE.OBJ into a directory,
where your components reside, for instance
C:\Programs\Borland\CBuilder\Lib\Obj
2. Copy file EXTPAGE.HPP into your include directory, for inst.
C:\Programs\Borland\CBuilder\Include\VCL
3. From the Borland C++Builder menu select
Component | Install ...
4. Press the Add button and select the path and filename of
your EXTPAGE.OBJ file. In the browse dialog pull down the
'Files of Type' combo box at the bottom and select file
type (*.OBJ).
5. Back on the Install Components screen press OK.
If installation succeeds you should see the ExtPageControl
and ExtTabControl appear on the Win95 palette. If you have any
difficulty installing the components refer to the Borland
C++Builder Help system.
Registration
============
ExtPageControl and ExtTabControl are Shareware. A free Trial
version gives you the opportunity to try these native components.
They have the full functionality of the registered version, but
can run only when Delphi or Borland C++Builder is also running
on the PC.
To deliver an application using these components, you must purchase
the applicable version. The registration fee is US $39.95. You get
full source code and lifetime technical support via Compuserve
and Internet. We will send the source code to your e-mail address.
Please see file Order.txt for details.
FAQ
====
Q: Is ExtPageControl a subclass of TCustomTabControl?
A: ExtPageControl and ExtTabControl are indirect subclasses
of TCustomTabControl. That's the class tree:
TCustomTabControl (Delphi VCL)
| |
TPageControl TTabControl (Delphi VCL)
| |
TExtPageControl TExtTabControl
Q: Why have a uniform tab width? Can tabs be different widths?
I need this functionality.
A: Tabs can have different width if they are on top or on
bottom of the control. Set property TabWidth to zero.
Only if the tabs are on the left or right side of the
control they must have the same (fixed) width.
Q: Is it possible to have each tab a different color?
A: Yes, simply insert some code in event OnDrawTab. In Delphi
write:
with TExtPageControl(Control) do begin
Case Index Of
// color of Tab 1
0: Canvas.Brush.Color:= RGB(192, 220, 192);
// color of Tab 2
1: Canvas.Brush.Color:= clYellow;
// color of Tab 3
2: Canvas.Brush.Color:= RGB(166, 202, 240);
End;
Canvas.FillRect(RectBg);
DefaultDrawTab(Index, RectFg, State);
end;
Check if unit StdCtrls is included in the uses clause of your
file. In C++Builder you can write:
TExtPageControl *ExtPgCtrol = (TExtPageControl*)Control;
switch(Index)
{
case 0: // color of Tab 1
ExtPgCtrol->Canvas->Brush->Color = RGB(192, 220, 192);
break;
case 1: // color of Tab 2
ExtPgCtrol->Canvas->Brush->Color = clYellow;
break;
case 2: // color of Tab 3
ExtPgCtrol->Canvas->Brush->Color = RGB(166, 202, 240);
break;
};
ExtPgCtrol->Canvas->FillRect(RectBg);
ExtPgCtrol->DefaultDrawTab(Index, RectFg, State);
Q: How do you go about changing the lettering color of one tab?
Lets say you have five tabs, all the tabs have gray background
and black lettering which is the norm. One of the tabs need to
stand out and be a different color (just for the letters), the
background would remain the same.
A: In Delphi insert this code in event OnDrawTab:
with TExtPageControl(Control) do begin
Case Index Of
0: Canvas.Font.Color:= clNavy; // blue text on Tab 1
1: Canvas.Font.Color:= clRed; // red text on Tab 2
2: Canvas.Font.Color:= clGreen; // green text on Tab 3
End;
DefaultDrawTab(Index, RectFg, State);
end;
Check if unit StdCtrls is included in the uses clause of your
file. In C++Builder insert this code in event OnDrawTab:
TExtPageControl *ExtPgCtrol = (TExtPageControl*)Control;
switch(Index)
{
case 0: // blue text on Tab 1
ExtPgCtrol->Canvas->Font->Color = clNavy;
break;
case 1: // red text on Tab 2
ExtPgCtrol->Canvas->Font->Color = clRed;
break;
case 2: // green text on Tab 3
ExtPgCtrol->Canvas->Font->Color = clGreen;
break;
};
ExtPgCtrol->DefaultDrawTab(Index, RectFg, State);
Q: I currently have a PageControl that is about 8 pages
big with a lot of controls on each page. Is it possible to
substitute ExtPageControl with PageControl without
starting from scratch. I tried the cut and paste routine
along with all the source but its a real pain and not
working to well.
A: Select your form in design-mode. Press keys ALT+F12 -> you
should be in form-edit mode now. Search for your TPageControl
and replace it by TExtPageControl. Press ALT+F12 again and
save your work. This works the same way in Delphi and Borland
C++Builder.
Q: How do I get bitmaps into the tabs? How do I use property
TabGlyphs?
A: All images for the different tabs are stored in one large
bitmap (property TabGlyphs.Glyph). All images must be the same
size and next to each other in a horizontal row. You must
specify the number of images that are in the bitmap with the
TabGlyphs.NumGlyphs property. If you have for instance 5 tabs
in your control and each tab image has a height of 18
pixel and a width of 16 pixel, then the bitmap must be 18 pixel
high and 5*16 = 80 pixel wide. Set property TabGlyphs.NumGlyphs
to 5.
You can create the bitmap with any bitmap editor. With Delphi
and Borland C++Builder comes an ImageEditor (imagedit.exe).
Property TabGlyphs.TransparentColor determines partial
transparent parts in the image.
Property TabGlyphs.Spacing determines the number of pixels
between the image (specified in the Glyph property) and the text
(specified in the Caption property of each TabSheet for Ext-
PageControl and specified in property Tabs for ExtTabControl).
The default value is 5 pixels.
Q: What is largest Glyph size that can be used? (21x21, OK?)
A: I'm not aware of any glyph size limitation. So, 21x21 should
work without problems.
Q: Some Pagecontrols offer system resource reduction by freeing
window handles for all pages except the current one. I now
have so many controls in my Extpage2 that I really need a
feature like that. Can you add such a feature to Extpage2?
A: Yes, the public procedure DestroyAllOtherSheetHandles in
ExtPageControl frees the resources of all TabSheets except
the current one. If you call this procedure in event OnChange
of the PageControl then only the current Sheet uses system
resources.
In Delphi you may write:
procedure TForm1.ExtPageControl1Change(Sender: TObject);
begin
TExtPageControl(Sender).DestroyAllOtherSheetHandles;
end;
In Borland C++Builder write:
void __fastcall TForm1::ExtPageControl1Change(TObject *Sender)
{
((TExtPageControl*)Sender)->DestroyAllOtherSheetHandles();
}
Q: Is there a difference in when OnChange event is fired between
Delphi's PageControl and your ExtPageControl?
A: Yes. Let's say you are on page TabSheet1. A function call like
ExtPageControl1.ActivePage:= TabSheet2;
selects page TabSheet2 and fires the events OnChanging and On-
Change. The same function call does not fire OnChanging / On-
Change events in Delphi's PageControl.
OnChanging and OnChange events are also fired if property Tab-
Index is changed in ExtTabControl.
Q: How can I disable a Tab in ExtTabControl?
A: You can disable a Tab at run-time only. To disable the third
Tab write:
ExtTabControl1.TabEnabled[2]:= False;
Q: How can I disable a Tab in ExtPageControl?
A: A Tab is disabled if the corresponding Page is disabled.
TabSheet3.Enabled:= False;
ExtPageControl1.Invalidate;
By the way, you can always switch between the pages of a PageControl
by pressing the keys CTRL + TAB. Pressing CTRL + SHIFT + TAB switches
back. These shortcuts work system wide with all PageControls.
Jan - Michael Strube
e-mail: 100333.2744@compuserve.com
WWW: http://ourworld.compuserve.com/homepages/praxisservice/
-*- EOF -*-